// pages/user/shopFollow/index.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    list: [],
    total:20,
    pageSize:5,
    pageNum:1
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.setData({
      list:[
        {name:'烤肉',score:'4.7',num:'478',send:'15',sendMoney:'0.9',time:'42',juli:'1.8'},
        {name:'烤肉1',score:'4.7',num:'478',send:'15',sendMoney:'0.9',time:'42',juli:'1.8'},
        {name:'烤肉2',score:'4.7',num:'478',send:'15',sendMoney:'0.9',time:'42',juli:'1.8'},
        {name:'烤肉3',score:'4.7',num:'478',send:'15',sendMoney:'0.9',time:'42',juli:'1.8'},
        {name:'烤肉4',score:'4.7',num:'478',send:'15',sendMoney:'0.9',time:'42',juli:'1.8'}
      ]
    })
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
    console.log('下拉了')
    setTimeout(()=>{
      wx.stopPullDownRefresh()
    },1000)
  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
    if(this.data.total>this.data.list.length){
      setTimeout(()=>{
        let arr=[
          {name:'烤肉',score:'4.7',num:'478',send:'15',sendMoney:'0.9',time:'42',juli:'1.8'},
          {name:'烤肉1',score:'4.7',num:'478',send:'15',sendMoney:'0.9',time:'42',juli:'1.8'},
          {name:'烤肉2',score:'4.7',num:'478',send:'15',sendMoney:'0.9',time:'42',juli:'1.8'},
          {name:'烤肉3',score:'4.7',num:'478',send:'15',sendMoney:'0.9',time:'42',juli:'1.8'},
          {name:'烤肉4',score:'4.7',num:'478',send:'15',sendMoney:'0.9',time:'42',juli:'1.8'}
        ]
        let data=this.data.list.concat(arr)
        this.setData({
          list:data
        })
      },1000)
    }
  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})